﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Web;
using System.Web.Security;
using Htss.Platform.Web;

namespace DreamBox.Web.Box
{
    public class loginoutBox:ControllerBox
    {
        public void Load()
        {
            //清除回话状态
            Session.Remove("UserID");
            Session.Remove("UserName");
            Session.Remove("Email");
            Session.Remove("Avatar");
            Session.Remove("GID");
            if (Session["GroupCompetenceData"] != null)
            {
                Session.Remove("GroupCompetenceData");
            }
            //删除Cookies
            DreamBox.BLL.User.Cookies.Delete(Response, Request);
            //更新用户组为默认组
            DreamBox.BLL.User.Competence.ComGroupRight group = new BLL.User.Competence.ComGroupRight();
            group.SetCompetence(System.Web.HttpContext.Current, group.GetDefaultCompetence());
            Response.Redirect("/portal");
        }
    }
}
